package top.techqi.hamtools.db.assist

import android.support.annotation.IntRange

enum class FreqUnit(val value: Int) {
    Hz(0),
    kHz(1),
    MHz(2),
    GHz(3);

    companion object {
        fun valueOf(@IntRange(from = 0, to = 5) value: Int): FreqUnit {
            return when (value) {
                1 -> FreqUnit.kHz
                2 -> FreqUnit.MHz
                3 -> FreqUnit.GHz
                else -> FreqUnit.Hz
            }
        }
    }
}